package com.wavehi.web.homework.first;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @Author WaveHi
 * @Date 17/9/2021 下午 8:28
 * @Version 1.0
 * @Contact HJBWaveHi@163.com
 * @Description
 */
@WebServlet("/dispatcherDemoServlet02")
public class DispatcherDemoServlet02 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //统一字符集
        req.setCharacterEncoding("UTF-8");
        resp.setContentType("UTF-8");
        //获取输入流
        PrintWriter print = resp.getWriter();
        //回传信息
        print.write("I am servlet02!");
    }
}
